Skip to content

Support containers for blueprints#15983

Merged
elit0451 merged 11 commits intov14/devfrom
v14/feature/blueprint-containers
Apr 8, 2024
Merged

Support containers for blueprints#15983
elit0451 merged 11 commits intov14/devfrom
v14/feature/blueprint-containers

Conversation

@kjac
Copy link
Contributor

@kjac kjac commented Apr 4, 2024

Prerequisites

  • I have added steps to test this contribution in the description below

Description

This PR introduces blueprint containers (folders) for explicitly organizing blueprints in a tree, rather than the current virtual (fake) structure by content type.

As part of the migration to V14, all existing blueprints will be moved into containers named by their content type, thus mimicking the structure that is today.

Testing this PR

Create a V13 site with blueprints (or reach out to @kjac for a test DB):

image

Upgrade the V13 database to V14, then use the API to verify that the blueprints have been moved into containers:

image

image

Now test that:

  • New blueprints can be created in containers.
  • Existing blueprints can be moved between containers.
  • Existing blueprints can be moved to and from the tree root.
  • New containers can be created.
  • Existing containers can be renamed.0
  • Containers can not be moved to other containers.
  • Containers can not be deleted if they are not empty.
  • The blueprint items endpoint supports container items too.
  • Containers are listed before blueprints in the tree endpoints, and pagination works across both types.

Limitations of this PR

This PR does not support creating blueprints from existing content in a container. We need to work out the client-side details of this feature before we implement the APIs to support it.

@kjac kjac marked this pull request as ready for review April 8, 2024 07:47
Copy link
Contributor

@elit0451 elit0451 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great 🙌

We already went over my review suggestions, but for documentation purposes here are the things I'll push:

  • Added CancellationToken to the new endpoints;
  • Fixed authz policies of the new controllers;
  • Refactored ContentBlueprintEditingService.MoveAsync() to use the ContentBlueprintEditingService methods instead of underlying ContentService.

I'd just ask you to use Assert.Multiple where it makes sense in ContentBlueprintContainerServiceTests

@elit0451 elit0451 merged commit ddf663d into v14/dev Apr 8, 2024
@elit0451 elit0451 deleted the v14/feature/blueprint-containers branch April 8, 2024 12:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants